package org.fatewa.engine.exception;

import org.fatewa.engine.advice.protocol.RayquazaResponse;
import org.fatewa.engine.design.advice.AbstractExceptionProcessor;
import org.springframework.http.HttpStatus;
import org.springframework.http.converter.HttpMessageNotReadableException;

/**
 * @author fatewa
 */
public class HttpMessageNotReadableProcessor extends AbstractExceptionProcessor<HttpMessageNotReadableException> {
    @Override
    public RayquazaResponse map(HttpMessageNotReadableException e) {
        return new RayquazaResponse()
                .code(HttpStatus.BAD_REQUEST)
                .msg("参数不可读，请正确传参");
    }
}
